.class public Lcom/zuimeia/ui/draggablegridview/DraggableGridView;
.super Landroid/view/ViewGroup;
.source "DraggableGridView.java"

# interfaces
.implements Landroid/view/View$OnClickListener;
.implements Landroid/view/View$OnLongClickListener;


# static fields
.field public static animT:I

.field public static childRatio:F


# instance fields
.field protected childSize:I

.field protected colCount:I

.field protected dpi:I

.field protected dragged:I

.field protected enabled:Z

.field protected handler:Landroid/os/Handler;

.field protected lastTarget:I

.field protected lastX:I

.field protected lastY:I

.field private leftPadding:I

.field private mAnimators:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Landroid/view/View;",
            "Landroid/animation/Animator;",
            ">;"
        }
    .end annotation
.end field

.field private mDraggable:Z

.field private mEditMode:Z

.field private mIgnoreViews:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Landroid/view/View;",
            ">;"
        }
    .end annotation
.end field

.field protected newPositions:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Ljava/lang/Integer;",
            ">;"
        }
    .end annotation
.end field

.field private onItemClickListener:Landroid/widget/AdapterView$OnItemClickListener;

.field protected onRearrangeListener:Lcom/zuimeia/ui/draggablegridview/OnRearrangeListener;

.field originX:F

.field originY:F

.field protected padding:I

.field private rightPadding:I

.field protected scroll:I

.field protected secondaryOnClickListener:Landroid/view/View$OnClickListener;

.field protected secondaryOnLongClickListener:Landroid/view/View$OnLongClickListener;

.field protected touching:Z


# direct methods
.method static constructor <clinit>()V
    .registers 1

    .prologue
    .line 32
    const/high16 v0, 0x3f800000

    sput v0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->childRatio:F

    .line 40
    const/16 v0, 0x96

    sput v0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->animT:I

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .registers 7
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "attrs"    # Landroid/util/AttributeSet;

    .prologue
    const/4 v3, 0x0

    const/4 v2, 0x1

    const/4 v1, -0x1

    .line 60
    invoke-direct {p0, p1, p2}, Landroid/view/ViewGroup;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 33
    iput v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    .line 35
    new-instance v0, Landroid/os/Handler;

    invoke-direct {v0}, Landroid/os/Handler;-><init>()V

    iput-object v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->handler:Landroid/os/Handler;

    .line 37
    iput v1, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    iput v1, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->lastX:I

    iput v1, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->lastY:I

    iput v1, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->lastTarget:I

    .line 38
    iput-boolean v2, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->enabled:Z

    iput-boolean v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->touching:Z

    .line 41
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->newPositions:Ljava/util/ArrayList;

    .line 48
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mAnimators:Ljava/util/HashMap;

    .line 49
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mIgnoreViews:Ljava/util/ArrayList;

    .line 51
    iput-boolean v2, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mDraggable:Z

    .line 61
    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->setListeners()V

    .line 64
    invoke-virtual {p0, v2}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->setChildrenDrawingOrderEnabled(Z)V

    .line 66
    invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v0

    iget v0, v0, Landroid/util/DisplayMetrics;->densityDpi:I

    iput v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dpi:I

    .line 67
    const/4 v0, 0x3

    iput v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->colCount:I

    .line 69
    const/high16 v0, 0x41700000

    invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    invoke-virtual {v1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v1

    invoke-static {v2, v0, v1}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F

    move-result v0

    float-to-int v0, v0

    iput v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->rightPadding:I

    iput v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->leftPadding:I

    .line 70
    return-void
.end method

.method private resolveMeasured(II)I
    .registers 6
    .param p1, "measureSpec"    # I
    .param p2, "desired"    # I

    .prologue
    .line 172
    const/4 v0, 0x0

    .line 173
    .local v0, "result":I
    invoke-static {p1}, Landroid/view/View$MeasureSpec;->getSize(I)I

    move-result v1

    .line 174
    .local v1, "specSize":I
    invoke-static {p1}, Landroid/view/View$MeasureSpec;->getMode(I)I

    move-result v2

    sparse-switch v2, :sswitch_data_16

    .line 183
    move v0, v1

    .line 185
    :goto_d
    return v0

    .line 176
    :sswitch_e
    move v0, p2

    .line 177
    goto :goto_d

    .line 179
    :sswitch_10
    invoke-static {v1, p2}, Ljava/lang/Math;->max(II)I

    move-result v0

    .line 180
    goto :goto_d

    .line 174
    nop

    :sswitch_data_16
    .sparse-switch
        -0x80000000 -> :sswitch_10
        0x0 -> :sswitch_e
    .end sparse-switch
.end method


# virtual methods
.method public addIgnoreView(Landroid/view/View;)V
    .registers 3
    .param p1, "view"    # Landroid/view/View;

    .prologue
    .line 86
    iget-object v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mIgnoreViews:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 87
    return-void
.end method

.method public addView(Landroid/view/View;)V
    .registers 4
    .param p1, "child"    # Landroid/view/View;

    .prologue
    .line 124
    invoke-super {p0, p1}, Landroid/view/ViewGroup;->addView(Landroid/view/View;)V

    .line 125
    iget-object v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->newPositions:Ljava/util/ArrayList;

    const/4 v1, -0x1

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 127
    return-void
.end method

.method protected animateDragged(I)V
    .registers 10
    .param p1, "index"    # I

    .prologue
    const/4 v7, 0x2

    .line 406
    iget v5, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->lastX:I

    int-to-float v5, v5

    iput v5, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->originX:F

    .line 407
    iget v5, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->lastY:I

    int-to-float v5, v5

    iput v5, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->originY:F

    .line 408
    iput p1, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    .line 410
    invoke-virtual {p0, p1}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildAt(I)Landroid/view/View;

    move-result-object v4

    .line 412
    .local v4, "v":Landroid/view/View;
    new-instance v2, Landroid/animation/AnimatorSet;

    invoke-direct {v2}, Landroid/animation/AnimatorSet;-><init>()V

    .line 413
    .local v2, "animatorSet":Landroid/animation/AnimatorSet;
    const-string v5, "scaleX"

    new-array v6, v7, [F

    fill-array-data v6, :array_6a

    invoke-static {v4, v5, v6}, Landroid/animation/ObjectAnimator;->ofFloat(Ljava/lang/Object;Ljava/lang/String;[F)Landroid/animation/ObjectAnimator;

    move-result-object v3

    .line 414
    .local v3, "scaleAnimator":Landroid/animation/ObjectAnimator;
    new-instance v5, Lcom/zuimeia/ui/draggablegridview/DraggableGridView$1;

    invoke-direct {v5, p0, v4}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView$1;-><init>(Lcom/zuimeia/ui/draggablegridview/DraggableGridView;Landroid/view/View;)V

    invoke-virtual {v3, v5}, Landroid/animation/ObjectAnimator;->addUpdateListener(Landroid/animation/ValueAnimator$AnimatorUpdateListener;)V

    .line 422
    const-string v5, "alpha"

    new-array v6, v7, [F

    fill-array-data v6, :array_72

    invoke-static {v4, v5, v6}, Landroid/animation/ObjectAnimator;->ofFloat(Ljava/lang/Object;Ljava/lang/String;[F)Landroid/animation/ObjectAnimator;

    move-result-object v0

    .line 423
    .local v0, "alphaAnimator":Landroid/animation/ObjectAnimator;
    new-array v5, v7, [Landroid/animation/Animator;

    const/4 v6, 0x0

    aput-object v3, v5, v6

    const/4 v6, 0x1

    aput-object v0, v5, v6

    invoke-virtual {v2, v5}, Landroid/animation/AnimatorSet;->playTogether([Landroid/animation/Animator;)V

    .line 424
    sget v5, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->animT:I

    int-to-long v6, v5

    invoke-virtual {v2, v6, v7}, Landroid/animation/AnimatorSet;->setDuration(J)Landroid/animation/AnimatorSet;

    .line 425
    new-instance v5, Lcom/zuimeia/ui/draggablegridview/DraggableGridView$2;

    invoke-direct {v5, p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView$2;-><init>(Lcom/zuimeia/ui/draggablegridview/DraggableGridView;)V

    invoke-virtual {v2, v5}, Landroid/animation/AnimatorSet;->addListener(Landroid/animation/Animator$AnimatorListener;)V

    .line 432
    iget-object v5, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mAnimators:Ljava/util/HashMap;

    invoke-virtual {v5, v4}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v5

    if-eqz v5, :cond_60

    .line 433
    iget-object v5, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mAnimators:Ljava/util/HashMap;

    invoke-virtual {v5, v4}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/animation/Animator;

    .line 434
    .local v1, "animator":Landroid/animation/Animator;
    invoke-virtual {v1}, Landroid/animation/Animator;->cancel()V

    .line 437
    .end local v1    # "animator":Landroid/animation/Animator;
    :cond_60
    iget-object v5, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mAnimators:Ljava/util/HashMap;

    invoke-virtual {v5, v4, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 438
    invoke-virtual {v2}, Landroid/animation/AnimatorSet;->start()V

    .line 440
    return-void

    .line 413
    nop

    :array_6a
    .array-data 4
        0x3f800000
        0x3f99999a
    .end array-data

    .line 422
    :array_72
    .array-data 4
        0x3f800000
        0x3f000000
    .end array-data
.end method

.method protected animateGap(I)V
    .registers 21
    .param p1, "target"    # I

    .prologue
    .line 474
    const/4 v11, 0x0

    .local v11, "i":I
    :goto_1
    invoke-virtual/range {p0 .. p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildCount()I

    move-result v3

    if-ge v11, v3, :cond_d8

    .line 475
    move-object/from16 v0, p0

    invoke-virtual {v0, v11}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildAt(I)Landroid/view/View;

    move-result-object v18

    .line 476
    .local v18, "v":Landroid/view/View;
    move-object/from16 v0, p0

    iget v3, v0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    if-ne v11, v3, :cond_16

    .line 474
    :cond_13
    :goto_13
    add-int/lit8 v11, v11, 0x1

    goto :goto_1

    .line 478
    :cond_16
    move v13, v11

    .line 479
    .local v13, "newPos":I
    move-object/from16 v0, p0

    iget v3, v0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    move/from16 v0, p1

    if-ge v3, v0, :cond_c2

    move-object/from16 v0, p0

    iget v3, v0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    add-int/lit8 v3, v3, 0x1

    if-lt v11, v3, :cond_c2

    move/from16 v0, p1

    if-gt v11, v0, :cond_c2

    .line 480
    add-int/lit8 v13, v13, -0x1

    .line 485
    :cond_2d
    :goto_2d
    move/from16 v16, v11

    .line 486
    .local v16, "oldPos":I
    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->newPositions:Ljava/util/ArrayList;

    invoke-virtual {v3, v11}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/lang/Integer;

    invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I

    move-result v3

    const/4 v4, -0x1

    if-eq v3, v4, :cond_4e

    .line 487
    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->newPositions:Ljava/util/ArrayList;

    invoke-virtual {v3, v11}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/lang/Integer;

    invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I

    move-result v16

    .line 488
    :cond_4e
    move/from16 v0, v16

    if-eq v0, v13, :cond_13

    .line 491
    move-object/from16 v0, p0

    move/from16 v1, v16

    invoke-virtual {v0, v1}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getCoorFromIndex(I)Landroid/graphics/Point;

    move-result-object v17

    .line 492
    .local v17, "oldXY":Landroid/graphics/Point;
    move-object/from16 v0, p0

    invoke-virtual {v0, v13}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getCoorFromIndex(I)Landroid/graphics/Point;

    move-result-object v14

    .line 493
    .local v14, "newXY":Landroid/graphics/Point;
    new-instance v15, Landroid/graphics/Point;

    move-object/from16 v0, v17

    iget v3, v0, Landroid/graphics/Point;->x:I

    invoke-virtual/range {v18 .. v18}, Landroid/view/View;->getLeft()I

    move-result v4

    sub-int/2addr v3, v4

    move-object/from16 v0, v17

    iget v4, v0, Landroid/graphics/Point;->y:I

    invoke-virtual/range {v18 .. v18}, Landroid/view/View;->getTop()I

    move-result v5

    sub-int/2addr v4, v5

    invoke-direct {v15, v3, v4}, Landroid/graphics/Point;-><init>(II)V

    .line 494
    .local v15, "oldOffset":Landroid/graphics/Point;
    new-instance v12, Landroid/graphics/Point;

    iget v3, v14, Landroid/graphics/Point;->x:I

    invoke-virtual/range {v18 .. v18}, Landroid/view/View;->getLeft()I

    move-result v4

    sub-int/2addr v3, v4

    iget v4, v14, Landroid/graphics/Point;->y:I

    invoke-virtual/range {v18 .. v18}, Landroid/view/View;->getTop()I

    move-result v5

    sub-int/2addr v4, v5

    invoke-direct {v12, v3, v4}, Landroid/graphics/Point;-><init>(II)V

    .line 496
    .local v12, "newOffset":Landroid/graphics/Point;
    new-instance v2, Landroid/view/animation/TranslateAnimation;

    const/4 v3, 0x0

    iget v4, v15, Landroid/graphics/Point;->x:I

    int-to-float v4, v4

    const/4 v5, 0x0

    iget v6, v12, Landroid/graphics/Point;->x:I

    int-to-float v6, v6

    const/4 v7, 0x0

    iget v8, v15, Landroid/graphics/Point;->y:I

    int-to-float v8, v8

    const/4 v9, 0x0

    iget v10, v12, Landroid/graphics/Point;->y:I

    int-to-float v10, v10

    invoke-direct/range {v2 .. v10}, Landroid/view/animation/TranslateAnimation;-><init>(IFIFIFIF)V

    .line 498
    .local v2, "translate":Landroid/view/animation/TranslateAnimation;
    sget v3, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->animT:I

    int-to-long v4, v3

    invoke-virtual {v2, v4, v5}, Landroid/view/animation/TranslateAnimation;->setDuration(J)V

    .line 499
    const/4 v3, 0x1

    invoke-virtual {v2, v3}, Landroid/view/animation/TranslateAnimation;->setFillEnabled(Z)V

    .line 500
    const/4 v3, 0x1

    invoke-virtual {v2, v3}, Landroid/view/animation/TranslateAnimation;->setFillAfter(Z)V

    .line 501
    invoke-virtual/range {v18 .. v18}, Landroid/view/View;->clearAnimation()V

    .line 502
    move-object/from16 v0, v18

    invoke-virtual {v0, v2}, Landroid/view/View;->startAnimation(Landroid/view/animation/Animation;)V

    .line 504
    move-object/from16 v0, p0

    iget-object v3, v0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->newPositions:Ljava/util/ArrayList;

    invoke-static {v13}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    invoke-virtual {v3, v11, v4}, Ljava/util/ArrayList;->set(ILjava/lang/Object;)Ljava/lang/Object;

    goto/16 :goto_13

    .line 481
    .end local v2    # "translate":Landroid/view/animation/TranslateAnimation;
    .end local v12    # "newOffset":Landroid/graphics/Point;
    .end local v14    # "newXY":Landroid/graphics/Point;
    .end local v15    # "oldOffset":Landroid/graphics/Point;
    .end local v16    # "oldPos":I
    .end local v17    # "oldXY":Landroid/graphics/Point;
    :cond_c2
    move-object/from16 v0, p0

    iget v3, v0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    move/from16 v0, p1

    if-ge v0, v3, :cond_2d

    move/from16 v0, p1

    if-lt v11, v0, :cond_2d

    move-object/from16 v0, p0

    iget v3, v0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    if-ge v11, v3, :cond_2d

    .line 482
    add-int/lit8 v13, v13, 0x1

    goto/16 :goto_2d

    .line 506
    .end local v13    # "newPos":I
    .end local v18    # "v":Landroid/view/View;
    :cond_d8
    return-void
.end method

.method protected animeteReset(I)V
    .registers 13
    .param p1, "index"    # I

    .prologue
    .line 443
    invoke-virtual {p0, p1}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildAt(I)Landroid/view/View;

    move-result-object v6

    .line 445
    .local v6, "v":Landroid/view/View;
    const-string v7, "translationX"

    const/4 v8, 0x2

    new-array v8, v8, [F

    const/4 v9, 0x0

    invoke-virtual {v6}, Landroid/view/View;->getTranslationX()F

    move-result v10

    aput v10, v8, v9

    const/4 v9, 0x1

    const/4 v10, 0x0

    aput v10, v8, v9

    invoke-static {v6, v7, v8}, Landroid/animation/ObjectAnimator;->ofFloat(Ljava/lang/Object;Ljava/lang/String;[F)Landroid/animation/ObjectAnimator;

    move-result-object v4

    .line 446
    .local v4, "transXAnimator":Landroid/animation/ObjectAnimator;
    const-string v7, "translationY"

    const/4 v8, 0x2

    new-array v8, v8, [F

    const/4 v9, 0x0

    invoke-virtual {v6}, Landroid/view/View;->getTranslationY()F

    move-result v10

    aput v10, v8, v9

    const/4 v9, 0x1

    const/4 v10, 0x0

    aput v10, v8, v9

    invoke-static {v6, v7, v8}, Landroid/animation/ObjectAnimator;->ofFloat(Ljava/lang/Object;Ljava/lang/String;[F)Landroid/animation/ObjectAnimator;

    move-result-object v5

    .line 448
    .local v5, "transYAnimator":Landroid/animation/ObjectAnimator;
    const-string v7, "scaleX"

    const/4 v8, 0x2

    new-array v8, v8, [F

    const/4 v9, 0x0

    invoke-virtual {v6}, Landroid/view/View;->getScaleX()F

    move-result v10

    aput v10, v8, v9

    const/4 v9, 0x1

    const/high16 v10, 0x3f800000

    aput v10, v8, v9

    invoke-static {v6, v7, v8}, Landroid/animation/ObjectAnimator;->ofFloat(Ljava/lang/Object;Ljava/lang/String;[F)Landroid/animation/ObjectAnimator;

    move-result-object v3

    .line 449
    .local v3, "scaleAnimator":Landroid/animation/ObjectAnimator;
    new-instance v7, Lcom/zuimeia/ui/draggablegridview/DraggableGridView$3;

    invoke-direct {v7, p0, v6}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView$3;-><init>(Lcom/zuimeia/ui/draggablegridview/DraggableGridView;Landroid/view/View;)V

    invoke-virtual {v3, v7}, Landroid/animation/ObjectAnimator;->addUpdateListener(Landroid/animation/ValueAnimator$AnimatorUpdateListener;)V

    .line 457
    const-string v7, "alpha"

    const/4 v8, 0x2

    new-array v8, v8, [F

    const/4 v9, 0x0

    invoke-virtual {v6}, Landroid/view/View;->getAlpha()F

    move-result v10

    aput v10, v8, v9

    const/4 v9, 0x1

    const/high16 v10, 0x3f800000

    aput v10, v8, v9

    invoke-static {v6, v7, v8}, Landroid/animation/ObjectAnimator;->ofFloat(Ljava/lang/Object;Ljava/lang/String;[F)Landroid/animation/ObjectAnimator;

    move-result-object v0

    .line 459
    .local v0, "alphaAnimator":Landroid/animation/ObjectAnimator;
    new-instance v2, Landroid/animation/AnimatorSet;

    invoke-direct {v2}, Landroid/animation/AnimatorSet;-><init>()V

    .line 460
    .local v2, "animatorSet":Landroid/animation/AnimatorSet;
    const/4 v7, 0x4

    new-array v7, v7, [Landroid/animation/Animator;

    const/4 v8, 0x0

    aput-object v4, v7, v8

    const/4 v8, 0x1

    aput-object v5, v7, v8

    const/4 v8, 0x2

    aput-object v3, v7, v8

    const/4 v8, 0x3

    aput-object v0, v7, v8

    invoke-virtual {v2, v7}, Landroid/animation/AnimatorSet;->playTogether([Landroid/animation/Animator;)V

    .line 461
    sget v7, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->animT:I

    int-to-long v8, v7

    invoke-virtual {v2, v8, v9}, Landroid/animation/AnimatorSet;->setDuration(J)Landroid/animation/AnimatorSet;

    .line 462
    invoke-virtual {v2}, Landroid/animation/AnimatorSet;->start()V

    .line 464
    iget-object v7, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mAnimators:Ljava/util/HashMap;

    invoke-virtual {v7, v6}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v7

    if-eqz v7, :cond_91

    .line 465
    iget-object v7, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mAnimators:Ljava/util/HashMap;

    invoke-virtual {v7, v6}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/animation/Animator;

    .line 466
    .local v1, "animator":Landroid/animation/Animator;
    invoke-virtual {v1}, Landroid/animation/Animator;->cancel()V

    .line 469
    .end local v1    # "animator":Landroid/animation/Animator;
    :cond_91
    iget-object v7, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mAnimators:Ljava/util/HashMap;

    invoke-virtual {v7, v6, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 470
    invoke-virtual {v2}, Landroid/animation/AnimatorSet;->start()V

    .line 471
    return-void
.end method

.method protected clampScroll()V
    .registers 7

    .prologue
    const/4 v5, 0x0

    .line 571
    const/4 v2, 0x3

    .local v2, "stretch":I
    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getHeight()I

    move-result v3

    div-int/lit8 v1, v3, 0x2

    .line 572
    .local v1, "overreach":I
    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getMaxScroll()I

    move-result v0

    .line 573
    .local v0, "max":I
    invoke-static {v0, v5}, Ljava/lang/Math;->max(II)I

    move-result v0

    .line 575
    iget v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    neg-int v4, v1

    if-ge v3, v4, :cond_19

    .line 576
    neg-int v3, v1

    iput v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    .line 590
    :cond_18
    :goto_18
    return-void

    .line 577
    :cond_19
    iget v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    add-int v4, v0, v1

    if-le v3, v4, :cond_24

    .line 578
    add-int v3, v0, v1

    iput v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    goto :goto_18

    .line 579
    :cond_24
    iget v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    if-gez v3, :cond_3d

    .line 580
    iget v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    neg-int v4, v2

    if-lt v3, v4, :cond_30

    .line 581
    iput v5, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    goto :goto_18

    .line 582
    :cond_30
    iget-boolean v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->touching:Z

    if-nez v3, :cond_18

    .line 583
    iget v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    iget v4, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    div-int/2addr v4, v2

    sub-int/2addr v3, v4

    iput v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    goto :goto_18

    .line 584
    :cond_3d
    iget v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    if-le v3, v0, :cond_18

    .line 585
    iget v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    add-int v4, v0, v2

    if-gt v3, v4, :cond_4a

    .line 586
    iput v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    goto :goto_18

    .line 587
    :cond_4a
    iget-boolean v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->touching:Z

    if-nez v3, :cond_18

    .line 588
    iget v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    iget v4, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    sub-int v4, v0, v4

    div-int/2addr v4, v2

    add-int/2addr v3, v4

    iput v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    goto :goto_18
.end method

.method public clearIgnoreIndex()V
    .registers 2

    .prologue
    .line 94
    iget-object v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mIgnoreViews:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    .line 95
    return-void
.end method

.method protected getChildDrawingOrder(II)I
    .registers 5
    .param p1, "childCount"    # I
    .param p2, "i"    # I

    .prologue
    .line 218
    iget v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    const/4 v1, -0x1

    if-ne v0, v1, :cond_6

    .line 224
    .end local p2    # "i":I
    :cond_5
    :goto_5
    return p2

    .line 220
    .restart local p2    # "i":I
    :cond_6
    add-int/lit8 v0, p1, -0x1

    if-ne p2, v0, :cond_d

    .line 221
    iget p2, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    goto :goto_5

    .line 222
    :cond_d
    iget v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    if-lt p2, v0, :cond_5

    .line 223
    add-int/lit8 p2, p2, 0x1

    goto :goto_5
.end method

.method protected getColOrRowFromCoor(I)I
    .registers 5
    .param p1, "coor"    # I

    .prologue
    .line 238
    iget v1, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->padding:I

    iget v2, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->leftPadding:I

    add-int/2addr v1, v2

    sub-int/2addr p1, v1

    .line 239
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_7
    if-lez p1, :cond_17

    .line 240
    iget v1, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->childSize:I

    if-ge p1, v1, :cond_e

    .line 244
    .end local v0    # "i":I
    :goto_d
    return v0

    .line 242
    .restart local v0    # "i":I
    :cond_e
    iget v1, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->childSize:I

    iget v2, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->padding:I

    add-int/2addr v1, v2

    sub-int/2addr p1, v1

    .line 239
    add-int/lit8 v0, v0, 0x1

    goto :goto_7

    .line 244
    :cond_17
    const/4 v0, -0x1

    goto :goto_d
.end method

.method protected getCoorFromIndex(I)Landroid/graphics/Point;
    .registers 10
    .param p1, "index"    # I

    .prologue
    .line 272
    iget v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->colCount:I

    rem-int v0, p1, v3

    .line 273
    .local v0, "col":I
    iget v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->colCount:I

    div-int v2, p1, v3

    .line 274
    .local v2, "row":I
    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    invoke-virtual {v3}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v3

    iget v1, v3, Landroid/util/DisplayMetrics;->density:F

    .line 275
    .local v1, "density":F
    const/high16 v3, 0x3fc00000

    cmpl-float v3, v1, v3

    if-nez v3, :cond_38

    .line 276
    new-instance v3, Landroid/graphics/Point;

    iget v4, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->padding:I

    iget v5, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->leftPadding:I

    add-int/2addr v4, v5

    iget v5, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->childSize:I

    iget v6, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->padding:I

    add-int/2addr v5, v6

    mul-int/2addr v5, v0

    add-int/2addr v4, v5

    iget v5, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->padding:I

    iget v6, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->childSize:I

    iget v7, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->padding:I

    add-int/2addr v6, v7

    mul-int/2addr v6, v2

    add-int/2addr v5, v6

    iget v6, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    sub-int/2addr v5, v6

    add-int/lit8 v5, v5, 0xa

    invoke-direct {v3, v4, v5}, Landroid/graphics/Point;-><init>(II)V

    .line 278
    :goto_37
    return-object v3

    :cond_38
    new-instance v3, Landroid/graphics/Point;

    iget v4, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->padding:I

    iget v5, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->leftPadding:I

    add-int/2addr v4, v5

    iget v5, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->childSize:I

    iget v6, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->padding:I

    add-int/2addr v5, v6

    mul-int/2addr v5, v0

    add-int/2addr v4, v5

    iget v5, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->padding:I

    iget v6, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->childSize:I

    iget v7, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->padding:I

    add-int/2addr v6, v7

    mul-int/2addr v6, v2

    add-int/2addr v5, v6

    iget v6, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    sub-int/2addr v5, v6

    invoke-direct {v3, v4, v5}, Landroid/graphics/Point;-><init>(II)V

    goto :goto_37
.end method

.method public getIndexFromCoor(II)I
    .registers 8
    .param p1, "x"    # I
    .param p2, "y"    # I

    .prologue
    const/4 v3, -0x1

    .line 228
    invoke-virtual {p0, p1}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getColOrRowFromCoor(I)I

    move-result v0

    .local v0, "col":I
    iget v4, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    add-int/2addr v4, p2

    invoke-virtual {p0, v4}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getColOrRowFromCoor(I)I

    move-result v2

    .line 229
    .local v2, "row":I
    if-eq v0, v3, :cond_10

    if-ne v2, v3, :cond_12

    :cond_10
    move v1, v3

    .line 234
    :cond_11
    :goto_11
    return v1

    .line 231
    :cond_12
    iget v4, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->colCount:I

    mul-int/2addr v4, v2

    add-int v1, v4, v0

    .line 232
    .local v1, "index":I
    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildCount()I

    move-result v4

    if-lt v1, v4, :cond_11

    move v1, v3

    .line 233
    goto :goto_11
.end method

.method public getIndexOf(Landroid/view/View;)I
    .registers 4
    .param p1, "child"    # Landroid/view/View;

    .prologue
    .line 282
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_1
    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildCount()I

    move-result v1

    if-ge v0, v1, :cond_11

    .line 283
    invoke-virtual {p0, v0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildAt(I)Landroid/view/View;

    move-result-object v1

    if-ne v1, p1, :cond_e

    .line 285
    .end local v0    # "i":I
    :goto_d
    return v0

    .line 282
    .restart local v0    # "i":I
    :cond_e
    add-int/lit8 v0, v0, 0x1

    goto :goto_1

    .line 285
    :cond_11
    const/4 v0, -0x1

    goto :goto_d
.end method

.method public getLastIndex()I
    .registers 3

    .prologue
    .line 598
    iget v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->lastX:I

    iget v1, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->lastY:I

    invoke-virtual {p0, v0, v1}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getIndexFromCoor(II)I

    move-result v0

    return v0
.end method

.method protected getMaxScroll()I
    .registers 7

    .prologue
    .line 593
    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildCount()I

    move-result v2

    int-to-double v2, v2

    iget v4, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->colCount:I

    int-to-double v4, v4

    div-double/2addr v2, v4

    invoke-static {v2, v3}, Ljava/lang/Math;->ceil(D)D

    move-result-wide v2

    double-to-int v1, v2

    .local v1, "rowCount":I
    iget v2, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->childSize:I

    mul-int/2addr v2, v1

    add-int/lit8 v3, v1, 0x1

    iget v4, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->padding:I

    mul-int/2addr v3, v4

    add-int/2addr v2, v3

    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getHeight()I

    move-result v3

    sub-int v0, v2, v3

    .line 594
    .local v0, "max":I
    return v0
.end method

.method protected getTargetFromCoor(II)I
    .registers 8
    .param p1, "x"    # I
    .param p2, "y"    # I

    .prologue
    const/4 v3, -0x1

    .line 248
    iget v4, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    add-int/2addr v4, p2

    invoke-virtual {p0, v4}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getColOrRowFromCoor(I)I

    move-result v4

    if-ne v4, v3, :cond_c

    move v2, v3

    .line 268
    :cond_b
    :goto_b
    return v2

    .line 253
    :cond_c
    iget v4, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->childSize:I

    div-int/lit8 v4, v4, 0x4

    sub-int v4, p1, v4

    invoke-virtual {p0, v4, p2}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getIndexFromCoor(II)I

    move-result v0

    .line 254
    .local v0, "leftPos":I
    iget v4, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->childSize:I

    div-int/lit8 v4, v4, 0x4

    add-int/2addr v4, p1

    invoke-virtual {p0, v4, p2}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getIndexFromCoor(II)I

    move-result v1

    .line 255
    .local v1, "rightPos":I
    if-ne v0, v3, :cond_25

    if-ne v1, v3, :cond_25

    move v2, v3

    .line 256
    goto :goto_b

    .line 257
    :cond_25
    if-ne v0, v1, :cond_29

    move v2, v3

    .line 258
    goto :goto_b

    .line 260
    :cond_29
    const/4 v2, -0x1

    .line 261
    .local v2, "target":I
    if-le v1, v3, :cond_34

    .line 262
    move v2, v1

    .line 265
    :cond_2d
    :goto_2d
    iget v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    if-ge v3, v2, :cond_b

    .line 266
    add-int/lit8 v2, v2, -0x1

    goto :goto_b

    .line 263
    :cond_34
    if-le v0, v3, :cond_2d

    .line 264
    add-int/lit8 v2, v0, 0x1

    goto :goto_2d
.end method

.method public onClick(Landroid/view/View;)V
    .registers 8
    .param p1, "view"    # Landroid/view/View;

    .prologue
    .line 290
    iget-boolean v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->enabled:Z

    if-eqz v0, :cond_2d

    .line 292
    iget-object v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->onItemClickListener:Landroid/widget/AdapterView$OnItemClickListener;

    if-eqz v0, :cond_2e

    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getLastIndex()I

    move-result v0

    const/4 v1, -0x1

    if-eq v0, v1, :cond_2e

    iget-boolean v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mEditMode:Z

    if-nez v0, :cond_2e

    .line 293
    iget-object v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->onItemClickListener:Landroid/widget/AdapterView$OnItemClickListener;

    const/4 v1, 0x0

    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getLastIndex()I

    move-result v2

    invoke-virtual {p0, v2}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildAt(I)Landroid/view/View;

    move-result-object v2

    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getLastIndex()I

    move-result v3

    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getLastIndex()I

    move-result v4

    iget v5, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->colCount:I

    div-int/2addr v4, v5

    int-to-long v4, v4

    invoke-interface/range {v0 .. v5}, Landroid/widget/AdapterView$OnItemClickListener;->onItemClick(Landroid/widget/AdapterView;Landroid/view/View;IJ)V

    .line 301
    :cond_2d
    :goto_2d
    return-void

    .line 295
    :cond_2e
    iget-object v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->secondaryOnClickListener:Landroid/view/View$OnClickListener;

    if-eqz v0, :cond_2d

    .line 296
    iget-object v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->secondaryOnClickListener:Landroid/view/View$OnClickListener;

    invoke-interface {v0, p1}, Landroid/view/View$OnClickListener;->onClick(Landroid/view/View;)V

    goto :goto_2d
.end method

.method protected onLayout(ZIIII)V
    .registers 14
    .param p1, "changed"    # Z
    .param p2, "l"    # I
    .param p3, "t"    # I
    .param p4, "r"    # I
    .param p5, "b"    # I

    .prologue
    .line 162
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_1
    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildCount()I

    move-result v2

    if-ge v0, v2, :cond_27

    .line 163
    iget v2, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    if-eq v0, v2, :cond_24

    .line 164
    invoke-virtual {p0, v0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getCoorFromIndex(I)Landroid/graphics/Point;

    move-result-object v1

    .line 165
    .local v1, "xy":Landroid/graphics/Point;
    invoke-virtual {p0, v0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildAt(I)Landroid/view/View;

    move-result-object v2

    iget v3, v1, Landroid/graphics/Point;->x:I

    iget v4, v1, Landroid/graphics/Point;->y:I

    iget v5, v1, Landroid/graphics/Point;->x:I

    iget v6, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->childSize:I

    add-int/2addr v5, v6

    iget v6, v1, Landroid/graphics/Point;->y:I

    iget v7, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->childSize:I

    add-int/2addr v6, v7

    invoke-virtual {v2, v3, v4, v5, v6}, Landroid/view/View;->layout(IIII)V

    .line 162
    .end local v1    # "xy":Landroid/graphics/Point;
    :cond_24
    add-int/lit8 v0, v0, 0x1

    goto :goto_1

    .line 169
    :cond_27
    return-void
.end method

.method public onLongClick(Landroid/view/View;)Z
    .registers 7
    .param p1, "view"    # Landroid/view/View;

    .prologue
    const/4 v2, 0x1

    const/4 v1, 0x0

    .line 304
    iget-boolean v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->enabled:Z

    if-nez v3, :cond_a

    iget-boolean v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mEditMode:Z

    if-nez v3, :cond_e

    :cond_a
    iget-boolean v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mDraggable:Z

    if-nez v3, :cond_f

    .line 322
    :cond_e
    :goto_e
    return v1

    .line 307
    :cond_f
    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getLastIndex()I

    move-result v0

    .line 308
    .local v0, "index":I
    iget-object v3, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mIgnoreViews:Ljava/util/ArrayList;

    invoke-virtual {p0, v0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildAt(I)Landroid/view/View;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/util/ArrayList;->contains(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_e

    .line 312
    const/4 v3, -0x1

    if-eq v0, v3, :cond_e

    .line 313
    iget-object v1, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->secondaryOnLongClickListener:Landroid/view/View$OnLongClickListener;

    if-eqz v1, :cond_2b

    .line 314
    iget-object v1, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->secondaryOnLongClickListener:Landroid/view/View$OnLongClickListener;

    invoke-interface {v1, p1}, Landroid/view/View$OnLongClickListener;->onLongClick(Landroid/view/View;)Z

    .line 317
    :cond_2b
    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getParent()Landroid/view/ViewParent;

    move-result-object v1

    invoke-interface {v1, v2}, Landroid/view/ViewParent;->requestDisallowInterceptTouchEvent(Z)V

    .line 319
    invoke-virtual {p0, v0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->animateDragged(I)V

    move v1, v2

    .line 320
    goto :goto_e
.end method

.method protected onMeasure(II)V
    .registers 15
    .param p1, "widthMeasureSpec"    # I
    .param p2, "heightMeasureSpec"    # I

    .prologue
    const/4 v8, 0x0

    .line 190
    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getSuggestedMinimumWidth()I

    move-result v3

    .line 191
    .local v3, "minimumWidth":I
    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getSuggestedMinimumHeight()I

    move-result v2

    .line 192
    .local v2, "minimumHeight":I
    invoke-direct {p0, p1, v3}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->resolveMeasured(II)I

    move-result v6

    .line 193
    .local v6, "viewWidth":I
    invoke-direct {p0, p2, v2}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->resolveMeasured(II)I

    move-result v5

    .line 195
    .local v5, "viewHeight":I
    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildCount()I

    move-result v0

    .line 196
    .local v0, "childCount":I
    if-lez v0, :cond_6d

    .line 197
    const/4 v1, 0x0

    .local v1, "i":I
    :goto_18
    if-ge v1, v0, :cond_24

    .line 198
    invoke-virtual {p0, v1}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildAt(I)Landroid/view/View;

    move-result-object v7

    invoke-virtual {v7, v8, v8}, Landroid/view/View;->measure(II)V

    .line 197
    add-int/lit8 v1, v1, 0x1

    goto :goto_18

    .line 200
    :cond_24
    invoke-virtual {p0, v8}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildAt(I)Landroid/view/View;

    move-result-object v7

    invoke-virtual {v7}, Landroid/view/View;->getMeasuredWidth()I

    move-result v7

    iput v7, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->childSize:I

    .line 206
    .end local v1    # "i":I
    :goto_2e
    iget v7, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->childSize:I

    int-to-float v7, v7

    sget v8, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->childRatio:F

    mul-float/2addr v7, v8

    invoke-static {v7}, Ljava/lang/Math;->round(F)I

    move-result v7

    iput v7, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->childSize:I

    .line 208
    iget v7, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->childSize:I

    iget v8, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->colCount:I

    mul-int/2addr v7, v8

    sub-int v7, v6, v7

    iget v8, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->leftPadding:I

    sub-int/2addr v7, v8

    iget v8, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->rightPadding:I

    sub-int/2addr v7, v8

    iget v8, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->colCount:I

    add-int/lit8 v8, v8, 0x1

    div-int/2addr v7, v8

    iput v7, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->padding:I

    .line 210
    const-wide/high16 v8, 0x3ff0000000000000L

    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildCount()I

    move-result v7

    int-to-double v10, v7

    mul-double/2addr v8, v10

    iget v7, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->colCount:I

    int-to-double v10, v7

    div-double/2addr v8, v10

    invoke-static {v8, v9}, Ljava/lang/Math;->ceil(D)D

    move-result-wide v8

    double-to-int v4, v8

    .line 211
    .local v4, "row":I
    iget v7, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->childSize:I

    mul-int/2addr v7, v4

    add-int/lit8 v8, v4, 0x1

    iget v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->padding:I

    mul-int/2addr v8, v9

    add-int v5, v7, v8

    .line 213
    invoke-virtual {p0, v6, v5}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->setMeasuredDimension(II)V

    .line 214
    return-void

    .line 203
    .end local v4    # "row":I
    :cond_6d
    iget v7, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->colCount:I

    div-int v7, v6, v7

    iput v7, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->childSize:I

    goto :goto_2e
.end method

.method public onTouchEvent(Landroid/view/MotionEvent;)Z
    .registers 14
    .param p1, "event"    # Landroid/view/MotionEvent;

    .prologue
    const/4 v10, 0x0

    const/4 v8, 0x1

    const/4 v11, -0x1

    .line 327
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I

    move-result v0

    .line 328
    .local v0, "action":I
    and-int/lit16 v9, v0, 0xff

    packed-switch v9, :pswitch_data_c0

    .line 396
    :cond_c
    :goto_c
    iget v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    if-eq v9, v11, :cond_b9

    .line 399
    :goto_10
    return v8

    .line 330
    :pswitch_11
    iput-boolean v8, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->enabled:Z

    .line 331
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F

    move-result v9

    float-to-int v9, v9

    iput v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->lastX:I

    .line 332
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F

    move-result v9

    float-to-int v9, v9

    iput v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->lastY:I

    .line 333
    iput-boolean v8, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->touching:Z

    .line 335
    iget-boolean v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mEditMode:Z

    if-eqz v9, :cond_c

    .line 337
    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getLastIndex()I

    move-result v1

    .line 338
    .local v1, "index":I
    if-eq v1, v11, :cond_c

    iget-object v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mIgnoreViews:Ljava/util/ArrayList;

    invoke-virtual {p0, v1}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildAt(I)Landroid/view/View;

    move-result-object v10

    invoke-virtual {v9, v10}, Ljava/util/ArrayList;->contains(Ljava/lang/Object;)Z

    move-result v9

    if-nez v9, :cond_c

    .line 339
    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getParent()Landroid/view/ViewParent;

    move-result-object v9

    invoke-interface {v9, v8}, Landroid/view/ViewParent;->requestDisallowInterceptTouchEvent(Z)V

    .line 340
    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getLastIndex()I

    move-result v9

    invoke-virtual {p0, v9}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->animateDragged(I)V

    goto :goto_c

    .line 347
    .end local v1    # "index":I
    :pswitch_48
    iget v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    if-eq v9, v11, :cond_89

    .line 349
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F

    move-result v9

    float-to-int v6, v9

    .local v6, "x":I
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F

    move-result v9

    float-to-int v7, v9

    .line 351
    .local v7, "y":I
    int-to-float v9, v6

    iget v10, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->originX:F

    sub-float/2addr v9, v10

    float-to-int v3, v9

    .line 352
    .local v3, "tranX":I
    int-to-float v9, v7

    iget v10, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->originY:F

    sub-float/2addr v9, v10

    float-to-int v4, v9

    .line 354
    .local v4, "tranY":I
    iget v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    invoke-virtual {p0, v9}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildAt(I)Landroid/view/View;

    move-result-object v5

    .line 355
    .local v5, "v":Landroid/view/View;
    int-to-float v9, v3

    invoke-virtual {v5, v9}, Landroid/view/View;->setTranslationX(F)V

    .line 356
    int-to-float v9, v4

    invoke-virtual {v5, v9}, Landroid/view/View;->setTranslationY(F)V

    .line 359
    invoke-virtual {p0, v6, v7}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getTargetFromCoor(II)I

    move-result v2

    .line 360
    .local v2, "target":I
    iget v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->lastTarget:I

    if-eq v9, v2, :cond_89

    .line 361
    if-eq v2, v11, :cond_89

    iget-object v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mIgnoreViews:Ljava/util/ArrayList;

    invoke-virtual {p0, v2}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildAt(I)Landroid/view/View;

    move-result-object v10

    invoke-virtual {v9, v10}, Ljava/util/ArrayList;->contains(Ljava/lang/Object;)Z

    move-result v9

    if-nez v9, :cond_89

    .line 362
    invoke-virtual {p0, v2}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->animateGap(I)V

    .line 363
    iput v2, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->lastTarget:I

    .line 376
    .end local v2    # "target":I
    .end local v3    # "tranX":I
    .end local v4    # "tranY":I
    .end local v5    # "v":Landroid/view/View;
    .end local v6    # "x":I
    .end local v7    # "y":I
    :cond_89
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F

    move-result v9

    float-to-int v9, v9

    iput v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->lastX:I

    .line 377
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F

    move-result v9

    float-to-int v9, v9

    iput v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->lastY:I

    goto/16 :goto_c

    .line 382
    :pswitch_99
    iget v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    if-eq v9, v11, :cond_af

    .line 383
    iget v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->lastTarget:I

    if-eq v9, v11, :cond_b3

    .line 384
    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->reorderChildren()V

    .line 388
    :goto_a4
    iput v11, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->lastTarget:I

    .line 389
    iput v11, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    .line 391
    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getParent()Landroid/view/ViewParent;

    move-result-object v9

    invoke-interface {v9, v10}, Landroid/view/ViewParent;->requestDisallowInterceptTouchEvent(Z)V

    .line 393
    :cond_af
    iput-boolean v10, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->touching:Z

    goto/16 :goto_c

    .line 386
    :cond_b3
    iget v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    invoke-virtual {p0, v9}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->animeteReset(I)V

    goto :goto_a4

    .line 399
    :cond_b9
    invoke-super {p0, p1}, Landroid/view/ViewGroup;->onTouchEvent(Landroid/view/MotionEvent;)Z

    move-result v8

    goto/16 :goto_10

    .line 328
    nop

    :pswitch_data_c0
    .packed-switch 0x0
        :pswitch_11
        :pswitch_99
        :pswitch_48
        :pswitch_99
        :pswitch_99
    .end packed-switch
.end method

.method public removeIgnoreView(Landroid/view/View;)V
    .registers 3
    .param p1, "view"    # Landroid/view/View;

    .prologue
    .line 90
    iget-object v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mIgnoreViews:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->remove(Ljava/lang/Object;)Z

    .line 91
    return-void
.end method

.method public removeViewAt(I)V
    .registers 4
    .param p1, "index"    # I

    .prologue
    .line 131
    invoke-virtual {p0, p1}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    .line 132
    .local v0, "removeView":Landroid/view/View;
    invoke-super {p0, p1}, Landroid/view/ViewGroup;->removeViewAt(I)V

    .line 133
    iget-object v1, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->newPositions:Ljava/util/ArrayList;

    invoke-virtual {v1, p1}, Ljava/util/ArrayList;->remove(I)Ljava/lang/Object;

    .line 135
    iget-object v1, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mIgnoreViews:Ljava/util/ArrayList;

    invoke-virtual {v1, v0}, Ljava/util/ArrayList;->contains(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_19

    .line 136
    iget-object v1, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mIgnoreViews:Ljava/util/ArrayList;

    invoke-virtual {v1, v0}, Ljava/util/ArrayList;->remove(Ljava/lang/Object;)Z

    .line 138
    :cond_19
    return-void
.end method

.method protected reorderChildren()V
    .registers 13

    .prologue
    .line 510
    iget-object v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->onRearrangeListener:Lcom/zuimeia/ui/draggablegridview/OnRearrangeListener;

    if-eqz v9, :cond_d

    .line 511
    iget-object v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->onRearrangeListener:Lcom/zuimeia/ui/draggablegridview/OnRearrangeListener;

    iget v10, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    iget v11, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->lastTarget:I

    invoke-interface {v9, v10, v11}, Lcom/zuimeia/ui/draggablegridview/OnRearrangeListener;->onRearrange(II)V

    .line 513
    :cond_d
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    .line 514
    .local v0, "children":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/view/View;>;"
    const/4 v4, 0x0

    .local v4, "i":I
    :goto_13
    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildCount()I

    move-result v9

    if-ge v4, v9, :cond_2a

    .line 515
    invoke-virtual {p0, v4}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildAt(I)Landroid/view/View;

    move-result-object v9

    invoke-virtual {v9}, Landroid/view/View;->clearAnimation()V

    .line 516
    invoke-virtual {p0, v4}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getChildAt(I)Landroid/view/View;

    move-result-object v9

    invoke-virtual {v0, v9}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 514
    add-int/lit8 v4, v4, 0x1

    goto :goto_13

    .line 518
    :cond_2a
    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->removeAllViews()V

    .line 519
    iget v7, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    .line 520
    .local v7, "oldIndex":I
    :cond_2f
    :goto_2f
    iget v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    iget v10, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->lastTarget:I

    if-eq v9, v10, :cond_77

    .line 521
    iget v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->lastTarget:I

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v10

    if-ne v9, v10, :cond_4b

    .line 523
    iget v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    invoke-virtual {v0, v9}, Ljava/util/ArrayList;->remove(I)Ljava/lang/Object;

    move-result-object v9

    invoke-virtual {v0, v9}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 524
    iget v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->lastTarget:I

    iput v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    goto :goto_2f

    .line 525
    :cond_4b
    iget v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    iget v10, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->lastTarget:I

    if-ge v9, v10, :cond_61

    .line 527
    iget v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    iget v10, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    add-int/lit8 v10, v10, 0x1

    invoke-static {v0, v9, v10}, Ljava/util/Collections;->swap(Ljava/util/List;II)V

    .line 528
    iget v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    add-int/lit8 v9, v9, 0x1

    iput v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    goto :goto_2f

    .line 529
    :cond_61
    iget v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    iget v10, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->lastTarget:I

    if-le v9, v10, :cond_2f

    .line 531
    iget v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    iget v10, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    add-int/lit8 v10, v10, -0x1

    invoke-static {v0, v9, v10}, Ljava/util/Collections;->swap(Ljava/util/List;II)V

    .line 532
    iget v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    add-int/lit8 v9, v9, -0x1

    iput v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    goto :goto_2f

    .line 536
    :cond_77
    const/4 v4, 0x0

    :goto_78
    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v9

    if-ge v4, v9, :cond_94

    .line 537
    iget-object v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->newPositions:Ljava/util/ArrayList;

    const/4 v10, -0x1

    invoke-static {v10}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v10

    invoke-virtual {v9, v4, v10}, Ljava/util/ArrayList;->set(ILjava/lang/Object;)Ljava/lang/Object;

    .line 538
    invoke-virtual {v0, v4}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v9

    check-cast v9, Landroid/view/View;

    invoke-virtual {p0, v9}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->addView(Landroid/view/View;)V

    .line 536
    add-int/lit8 v4, v4, 0x1

    goto :goto_78

    .line 541
    :cond_94
    iget v5, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    .line 542
    .local v5, "newIndex":I
    invoke-virtual {p0, v7}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getCoorFromIndex(I)Landroid/graphics/Point;

    move-result-object v8

    .line 543
    .local v8, "oldXy":Landroid/graphics/Point;
    invoke-virtual {p0, v5}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getCoorFromIndex(I)Landroid/graphics/Point;

    move-result-object v6

    .line 545
    .local v6, "newXy":Landroid/graphics/Point;
    iget v9, v6, Landroid/graphics/Point;->x:I

    iget v10, v8, Landroid/graphics/Point;->x:I

    sub-int v1, v9, v10

    .line 546
    .local v1, "deltaX":I
    iget v9, v6, Landroid/graphics/Point;->y:I

    iget v10, v8, Landroid/graphics/Point;->y:I

    sub-int v2, v9, v10

    .line 548
    .local v2, "deltaY":I
    iget v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    invoke-virtual {v0, v9}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Landroid/view/View;

    .line 550
    .local v3, "draggedView":Landroid/view/View;
    invoke-virtual {v3}, Landroid/view/View;->getTranslationX()F

    move-result v9

    int-to-float v10, v1

    sub-float/2addr v9, v10

    invoke-virtual {v3, v9}, Landroid/view/View;->setTranslationX(F)V

    .line 551
    invoke-virtual {v3}, Landroid/view/View;->getTranslationY()F

    move-result v9

    int-to-float v10, v2

    sub-float/2addr v9, v10

    invoke-virtual {v3, v9}, Landroid/view/View;->setTranslationY(F)V

    .line 553
    iget v9, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->dragged:I

    invoke-virtual {p0, v9}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->animeteReset(I)V

    .line 559
    return-void
.end method

.method public scrollToBottom()V
    .registers 2

    .prologue
    .line 566
    const v0, 0x7fffffff

    iput v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    .line 567
    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->clampScroll()V

    .line 568
    return-void
.end method

.method public scrollToTop()V
    .registers 2

    .prologue
    .line 562
    const/4 v0, 0x0

    iput v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->scroll:I

    .line 563
    return-void
.end method

.method public setColCount(I)V
    .registers 5
    .param p1, "colCount"    # I

    .prologue
    .line 73
    iput p1, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->colCount:I

    .line 74
    const/4 v0, 0x3

    if-le p1, v0, :cond_1d

    .line 75
    const/4 v0, 0x1

    const/high16 v1, 0x41400000

    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    invoke-virtual {v2}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v2

    invoke-static {v0, v1, v2}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F

    move-result v0

    float-to-int v0, v0

    iput v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->rightPadding:I

    iput v0, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->leftPadding:I

    .line 77
    :cond_1d
    invoke-virtual {p0}, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->invalidate()V

    .line 78
    return-void
.end method

.method public setDraggable(Z)V
    .registers 2
    .param p1, "draggable"    # Z

    .prologue
    .line 108
    iput-boolean p1, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mDraggable:Z

    .line 109
    return-void
.end method

.method public setEditMode(Z)V
    .registers 2
    .param p1, "editMode"    # Z

    .prologue
    .line 98
    iput-boolean p1, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->mEditMode:Z

    .line 100
    if-eqz p1, :cond_4

    .line 105
    :cond_4
    return-void
.end method

.method protected setListeners()V
    .registers 1

    .prologue
    .line 81
    invoke-super {p0, p0}, Landroid/view/ViewGroup;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 82
    invoke-super {p0, p0}, Landroid/view/ViewGroup;->setOnLongClickListener(Landroid/view/View$OnLongClickListener;)V

    .line 83
    return-void
.end method

.method public setOnClickListener(Landroid/view/View$OnClickListener;)V
    .registers 2
    .param p1, "l"    # Landroid/view/View$OnClickListener;

    .prologue
    .line 113
    iput-object p1, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->secondaryOnClickListener:Landroid/view/View$OnClickListener;

    .line 114
    return-void
.end method

.method public setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V
    .registers 2
    .param p1, "l"    # Landroid/widget/AdapterView$OnItemClickListener;

    .prologue
    .line 607
    iput-object p1, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->onItemClickListener:Landroid/widget/AdapterView$OnItemClickListener;

    .line 608
    return-void
.end method

.method public setOnLongClickListener(Landroid/view/View$OnLongClickListener;)V
    .registers 2
    .param p1, "l"    # Landroid/view/View$OnLongClickListener;

    .prologue
    .line 118
    iput-object p1, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->secondaryOnLongClickListener:Landroid/view/View$OnLongClickListener;

    .line 119
    return-void
.end method

.method public setOnRearrangeListener(Lcom/zuimeia/ui/draggablegridview/OnRearrangeListener;)V
    .registers 2
    .param p1, "l"    # Lcom/zuimeia/ui/draggablegridview/OnRearrangeListener;

    .prologue
    .line 603
    iput-object p1, p0, Lcom/zuimeia/ui/draggablegridview/DraggableGridView;->onRearrangeListener:Lcom/zuimeia/ui/draggablegridview/OnRearrangeListener;

    .line 604
    return-void
.end method
